#ifndef	_WIN32_ENGINE_H_
#define _WIN32_ENGINE_H_

namespace easy2d
{
	#include <Windows.h>

	class Engine : public EngineBase
	{
	public:
		Engine();
		virtual ~Engine();
		virtual bool start(uint width, uint height, EResolutionPolicy policy, bool isFullScreen);
		virtual void setTitle(const string& title);
		virtual void setWindowHandle(void* hWnd) {mHwnd = (HWND)hWnd;}
		virtual void* getWindowHandle() {return mHwnd;}
		
		virtual void externalClear();
		virtual void externalUpdate(uint elapsedTime);
		virtual void externalSwap();

		virtual void setSoftInputVisible(bool visible) {}
		virtual bool isSoftInputVisible() { return false; }

	protected:
		virtual void createModules();

	private:
		bool createWindow(uint width, uint height);
		bool initGLContext();
		void destroyGLContext();
		void deviceLostTest();
		static LRESULT CALLBACK onWndMsg(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam);

	protected:
		HWND  mHwnd;
		HDC   mHDC;
		HGLRC mHRC;		
	};





}	// namespace



#endif